package com.itlong.cloud.property.service;

import com.itlong.cloud.POJO.DTO.property.PropertyPaymentPageDTO;
import com.itlong.cloud.POJO.DTO.property.PropertySaveMeterInfoDTO;
import com.itlong.cloud.POJO.VO.property.PropertyGetManagementPageVO;
import com.itlong.cloud.POJO.VO.property.PropertyGetMeterInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertyPaymentGetPageVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.text.ParseException;
import java.util.List;

/**
 * <desc>
 *      物业收费管理业务处理接口
 * </desc>
 *
 * @createDate 2018/08/15
 */
public interface IPropertyPaymentManageService {
    /**
     * <desc>
     *      获取分页数据
     * </desc>
     *
     * @param pageDTO   参数DTO
     * @return
     * @author Jiaqi.X
     * @createDate 2017/09/27
     */
    Page<PropertyPaymentGetPageVO> getMeterInfoByPage(PropertyPaymentPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      保存抄表或物业费数据
     * </desc>
     *
     * @param dto
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/17
     */
    String saveOrUpdateMemterInfo(PropertySaveMeterInfoDTO dto) throws Exception;

    /**
     * <desc>
     *     获取物业费分页数据
     * </desc>
     *
     * @param pageDTO   参数DTO
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/20
     */
    Page<PropertyGetManagementPageVO> getManagementInfoByPage(PropertyPaymentPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      删除录入数据
     * </desc>
     *
     * @param feeDataId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/20
     */
    Integer deletePaymentRecord(String feeDataId) throws Exception;

    /**
     * <desc>
     *      通过id查询抄表费或物业费
     * </desc>
     *
     * @param feeDataId
     * @param type
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/21
     */
    PropertyGetMeterInfoVO getPaymentInfoById(String feeDataId,String type);

    /**
     * <desc>
     *      批量生成抄表费或物业费数据
     * </desc>
     *
     * @param buildIds 楼栋id,多个逗号分隔
     * @param type 1抄表费 2物业费
     * @param month 收费月份
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/22
     */
    Integer batchAddPaymentRecord(String buildIds,Integer type,String month) throws ParseException;

    /**
     * <desc>
     *      导入物业费数据
     * </desc>
     *
     * @param propertySaveMeterInfoDTOs
     * @author Jiaqi.X
     * @createDate 2018/08/30
     */
    void importSavePropertyFees(List<PropertySaveMeterInfoDTO> propertySaveMeterInfoDTOs) throws Exception;

    /**
     * <desc>
     *      检测导入数据的规则是否合法
     * </desc>
     *
     * @param roomName
     * @param ruleName
     * @param type 1抄表费 2物业费
     * @return
     * @author Jiaqi.X
     * @createDate 2018/10/17
     */
    public Integer checkImportDataRuleTime(String roomName,String ruleName,Integer type,String projectId,String month) throws ParseException;

    /**
     * <desc>
     *      导入抄表费
     * </desc>
     *
     * @param propertySaveMeterInfoDTOs
     * @author Jiaqi.X
     * @createDate 2018/08/30
     */
    String importSaveMeterInfoFees(List<PropertySaveMeterInfoDTO> propertySaveMeterInfoDTOs) throws Exception;

    /**
     * <desc>
     *      检测房间是否有业主
     * </desc>
     *
     * @param roomId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/09/03
     */
    Integer checkRoomHaveOwner(String roomId);

    /**
     * <desc>
     *      检查房间是否存在及是否有业主
     * </desc>
     *
     * @param address
     * @return
     * @author Jiaqi.X
     * @createDate 2018/09/03
     */
    Integer checkRoomExists(String address,String projectId);

    /**
     * <desc>
     *      检查收费规则是否存在
     * </desc>
     *
     * @param projectId 项目id
     * @param ruleName 规则名称
     * @return
     * @author Jiaqi.X
     * @createDate 2018/09/03
     */
    boolean checkRuleIsExists(String projectId,String ruleName,Integer type);

    /**
     * <desc>
     *      规则变更更改受影响的账单
     * </desc>
     *
     * @param feeRuleId
     * @author Jiaqi.X
     * @createDate 2018/09/04
     */
    void ruleChangeUpdateBill(String feeRuleId) throws Exception;

    /**
     * <desc>
     *      检测房间面积是否为空
     * </desc>
     *
     * @param roomId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/10/23
     */
    Integer checkRoomArea(String roomId);
}
